﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Interface{
    public partial class Interface : Form{
        public Interface(){
            InitializeComponent();            
        }
        private void getDataBtn_Click(object sender, EventArgs e){
            var min = Convert.ToDecimal(minInp.Value);
            var max = Convert.ToDecimal(maxInp.Value);
            var logika = new Logika();
            var filtered = logika.filter(min,max);
            var txt = new StringBuilder();
            foreach (var item in filtered)
                txt.AppendLine(item);
            resultTxtBox.Text = txt.ToString();
        }
        private void minInp_ValueChanged(object sender, EventArgs e){
            if (minInp.Value >= maxInp.Value)
                maxInp.Value = Decimal.Round(minInp.Value, 0)+1;
        }
        private void maxInp_ValueChanged(object sender, EventArgs e){
            if (minInp.Value >= maxInp.Value)
                minInp.Value = Decimal.Round(maxInp.Value, 0)+1;
        }
    }
}
